﻿@page "{Id}"

@using System.Globalization
@using Volo.Abp.AspNetCore.Mvc.UI.Packages.TuiEditor
@using Volo.Abp.AspNetCore.Mvc.UI.Packages.Uppy
@using Volo.CmsKit.Admin.Web.Bundles
@using Volo.CmsKit.Admin.Web.Menus
@using Volo.CmsKit.Admin.Web.Pages

@inherits CmsKitAdminPageBase

@model Volo.CmsKit.Admin.Web.Pages.CmsKit.Pages.UpdateModel

@{
    PageLayout.Content.Title = L["Pages"].Value;
    PageLayout.Content.BreadCrumb.Add(L["Menu:CMS"].Value);
    PageLayout.Content.MenuItemName = CmsKitAdminMenus.Pages.PagesMenu;
}


@section scripts {
    <abp-script-bundle>
        <abp-script type="typeof(TuiEditorScriptContributor)"/>
        <abp-script type="typeof(UppyScriptContributor)"/>
        <abp-script type="typeof(SlugifyScriptContributor)"/>
        <abp-script src="/Pages/CmsKit/Pages/update.js" />
    </abp-script-bundle>
}

@section styles {
    <abp-style-bundle>
        <abp-style type="typeof(TuiEditorStyleContributor)"/>
    </abp-style-bundle>
}

<abp-card>
    <abp-card-header title="@L["Update"].Value"></abp-card-header>
    <abp-card-body>
        <form asp-page="/CmsKit/Pages/Update" id="form-page-update">
            <abp-input asp-for="@Model.Id"/>
            
            <abp-input asp-for="@Model.ViewModel.Title"/>

            <abp-input asp-for="ViewModel.Slug" title="@L["PageSlugInformation"]" data-toggle="tooltip"/>

            <abp-input asp-for="@Model.ViewModel.Content"/>

            <div class="content-editor"
                 id="ContentEditor"
                 data-input-id="@Html.IdFor(x => x.ViewModel.Content)"
                 data-language="@(CultureInfo.CurrentUICulture.TwoLetterISOLanguageName)">
            </div>
        </form>
    </abp-card-body>
    <abp-card-footer>
        <abp-button button-type="Primary" type="submit" text="@L["Submit"].Value" id="button-page-update" />
    </abp-card-footer>
</abp-card>
